<?php

use yii\helpers\Html;
use yii\widgets\DetailView;

/* @var $this yii\web\View */
/* @var $model backend\models\Queues */

$this->title = Yii::t('app', 'Queue Information');
$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Queues'), 'url' => ['queue-list']];
$this->params['breadcrumbs'][] = $this->title;
\yii\web\YiiAsset::register($this);
?>
<div class="queues-view">

    <?= DetailView::widget([
        'model' => $model,
        'attributes' => [
            ['attribute' => 'queueId', 'value' => function($model){return empty($model->queueId) ? '' : $model->queueId;}],
            ['attribute' => 'queueKey', 'value' => function($model){return empty($model->queueKey) ? '' : $model->queueKey;}],
            ['attribute' => 'realName', 'value' => function($model){return empty($model->realName) ? '' : $model->realName;}],
            ['attribute' => 'idCardNo', 'value' => function($model){return empty($model->idCardNo) ? '' : $model->idCardNo;}],
            ['attribute' => 'queueNo', 'value' => function($model){return empty($model->queueNo) ? '' : $model->queueNo;}],
            ['attribute' => 'inData', 'value' => function($model){return $model->inData;}],
            ['attribute' => 'status', 'value' => function($model){
                switch($model->status){
                    case 1:return '排队成功';break;
                    case 2:return '核销成功';break;
                    case 3:return '已过期';break;
                    default:return '未知状态';break;
                } 
            }],
            ['attribute' => 'call', 'value' => function($model){
                switch($model->call){
                    case 1:return '等待叫号';break;
                    case 2:return '已叫号';break;
                    case 3:return '已过号';break;
                    default:return '未知状态';break;
                } 
            }],
            ['attribute' => 'ctime', 'value' => function($model){return empty($model->ctime) ? '' : date('Y-m-d H:i:s', $model->ctime);}],
            ['attribute' => 'queueNumber', 'value' => function($model){return $model->queueNumber;}],
        ],
    ]) ?>

</div>
